﻿<navigation:Page x:Class="RegOnline.StudPage" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
           xmlns:Converters="clr-namespace:RegOnline"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="800" d:DesignHeight="600"
            Title="StudPage Page"

    Style="{StaticResource PageStyle}"
                 >
    <UserControl.Resources>
        <Converters:PrintButtonVisibiliryConverter x:Key="printButtonVisibiliryConverter"/>
    </UserControl.Resources>



        <Grid  Name="InterfeceStudgGrid1" Style="{StaticResource LayoutRootPageGridStyle}">
        <Grid  Name="grid3" Margin="20,20,0,0" Height="30" VerticalAlignment="Top" HorizontalAlignment="Left" Width="720">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="60" />
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="170" />
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="90*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="2*" />
            </Grid.RowDefinitions>
            <sdk:Label Content="Группа:" HorizontalAlignment="Left" Margin="3" FontSize="12" Grid.Column="0" Grid.Row="0" />
            <ComboBox DisplayMemberPath="grupName" Grid.Column="1"  Grid.Row="0"  ItemsSource="{Binding}" Margin="3" Name="grupNameComboBox" SelectionChanged="grupNameComboBox_SelectionChanged" FontSize="12" Style="{StaticResource PageComboboxStyle}">
                <ComboBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel />
                    </ItemsPanelTemplate>
                </ComboBox.ItemsPanel>
            </ComboBox>
            <sdk:Label Content="Учебный семестр:" Grid.Column="2"  Grid.Row="0" HorizontalAlignment="Right" Margin="3"  FontSize="12" />
            <ComboBox DisplayMemberPath="SemNum" Grid.Column="3"  Grid.Row="0"    ItemsSource="{Binding}" Margin="3" Name="semNumComboBox"  FontSize="12" SelectionChanged="semNumComboBox_SelectionChanged" Style="{StaticResource PageComboboxStyle}">
                <ComboBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel />
                    </ItemsPanelTemplate>
                </ComboBox.ItemsPanel>
            </ComboBox>
            <Button Visibility="Collapsed" Content="Button" Height="23" HorizontalAlignment="Left" Margin="9,3,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" Grid.Column="4" />
        </Grid>
                <sdk:DataGrid CanUserResizeColumns="False" IsReadOnly="true" AutoGenerateColumns="False"  Margin="20,56,20,20" Name="upDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected"  FontSize="12" MouseLeftButtonUp="upDataGrid_MouseLeftButtonUp" SelectionChanged="upDataGrid_SelectionChanged" >
            <sdk:DataGrid.Resources>
                <Converters:PrintButtonVisibiliryConverter x:Key="printButtonVisibiliryConverter"/>
            </sdk:DataGrid.Resources>
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn x:Name="disColumn" Binding="{Binding Path=Dis.DisName}" Header="Дисциплина" Width="Auto" />
                <sdk:DataGridTextColumn x:Name="vidColumn" Binding="{Binding Path=Vid.VidWorkName}" Header="Вид работы" Width="Auto" />
                <sdk:DataGridTextColumn x:Name="wsColumn1" Binding="{Binding Path=Ws.RegNum}" Header="Регистрационнный № " Width="Auto" />
                <sdk:DataGridTextColumn x:Name="wsColumn2" Binding="{Binding Path=Ws.RegDate, StringFormat='dd.MM.yyyy'}" Header="Дата регистрации" Width="Auto" />
                <data:DataGridTemplateColumn Width="80">
                    <data:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <!---->
                            <Button x:Name="printFrm" Content="Печать" Foreground="DarkBlue"  Width="75" Click="printFrm_Click" Visibility="{Binding Converter={StaticResource printButtonVisibiliryConverter}}"></Button>
                        </DataTemplate>
                    </data:DataGridTemplateColumn.CellTemplate>
                </data:DataGridTemplateColumn>
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
    </Grid>

</navigation:Page>
